<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="UTF-8">
		<title></title>
		<a th:href="${#httpServletRequest.getScheme() + '://' + #httpServletRequest.getServerName() + ':' + #request.getServerPort()  + #request.getContextPath() + '/'} " id="contextPath"></a>
<!--		<link href ="img/favicon.ico" rel="shortcut icon">-->
		<script src="js/jquery-3.4.1.min.js"></script>
		<link rel="stylesheet" href="layui/css/layui.css">
		<script src="layui/layui.js"></script>


	</head>

	<body>

	<div class="layui-row layui-col-space10">
		<div class="layui-col-md8 layui-col-md-offset2">
			<h1 th:text="${name}">名称</h1>
			<button type="button" class="layui-btn" id="test1">
				<i class="layui-icon">&#xe67c;</i>上传图片
			</button>
		</div>
	</div>


	</body>
	<script>
		layui.use('upload', function(){
			var upload = layui.upload;

			//执行实例
			var uploadInst = upload.render({
				elem: '#test1' //绑定元素
				,url: '/test/upload/' //上传接口
				,done: function(jsonRes){
					//上传完毕回调
					layer.msg('上传完毕<br>'+jsonRes.msg);
				}
				,error: function(){
					//请求异常回调
					layer.msg('请求异常')
				}
			});
		});
	</script>
</html>
